from playwright.sync_api import Playwright, sync_playwright


def run(playwright: Playwright) -> None:
    # "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary"
    browser = playwright.chromium.launch(headless=False, channel='msedge')
    context = browser.new_context()
    page = context.new_page()
    page.goto("https://www.baidu.com/")

    # ---------------------
    context.close()
    browser.close()


with sync_playwright() as playwright:
    run(playwright)
